package com.zd.novel.mapper;

import com.zd.common.pojo.Author;
import com.zd.common.pojo.Novel;
import com.zd.common.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface NovelMapper {
    @Select("select * from zd_novel where name=#{name}")
    Novel selectName(String name);


    @Select("select * from zd_author where author_id=#{authorId}")
    Author selecctauthorById(Integer authorId);

        //1+1+3
    @Insert("insert into zd_novel value(null,#{classifyId},#{novelName},#{authorId},#{status},#{created},#{updated})")
    void insertNovel(Novel novel);

    @Select("select * from zd_user where user_id=#{id}")
    User selectUserByid(Integer id);

    @Select("select * from zd_novel where novel_id=#{novelId}")
    Novel selecdstatus(Integer novelId);
    //提交测试


}
